Learn R Programming

SpaDES (version 1.1.0)

setColors<-: Set colours for plotting Raster* objects.

Description

setColors works as a replacement method or a normal function call.

Usage

setColors(object, ..., n) <- value

## S3 method for class 'RasterLayer,numeric,character': setColors(object, ..., n) <- value

## S3 method for class 'RasterLayer,missing,character': setColors(object, ..., n) <- value

## S3 method for class 'Raster,numeric,list': setColors(object, ..., n) <- value

## S3 method for class 'Raster,missing,list': setColors(object, ..., n) <- value

setColors(object, value, n)

## S3 method for class 'RasterLayer,character,numeric': setColors(object, value, n)

## S3 method for class 'RasterLayer,character,missing': setColors(object, value)

Arguments

object
A Raster* object.
...
Additional arguments to colorRampPalette.
n
An optional vector of values specifiying the number of levels from which to interpolate the color palette.
value
Named list of hex color codes (e.g., from RColorBrewer::brewer.pal), corresponding to the names of RasterLayers in x.

Value

  • Returns a Raster with the colortable slot set to values.

See Also

brewer.pal, colorRampPalette.